class HandoverNewAreaEntity {
  List<HandoverNewAreaInfo>? areas;
  List<HandoverElderInfoEntity>? elderInfos;
  String? dutyTypeDesc;
  String? reportDate;
  int? relateElderCount;
  int? nurseCount;
  int? elderCount;
  int? id;
  bool? areaAuth; //添加交接内容权限
  String? summary;
  String? summaryTime;
  String? operator;

  HandoverNewAreaEntity({
    this.areas,
    this.elderInfos,
    this.dutyTypeDesc,
    this.reportDate,
    this.relateElderCount,
    this.nurseCount,
    this.elderCount,
    this.areaAuth,
    this.id,
    this.summary,
    this.summaryTime,
    this.operator,
  });

  factory HandoverNewAreaEntity.fromJson(Map<String, dynamic> json) {
    final originList = json['areas'] as List?;
    List<HandoverNewAreaInfo> protocolList =
        (originList??[]).map((value) => HandoverNewAreaInfo.fromJson(value)).toList();

    final originList1 = json['elderInfos'] as List?;
    List<HandoverElderInfoEntity> protocolList1 = (originList1??[])
        .map((value) => HandoverElderInfoEntity.fromJson(value))
        .toList();

    return HandoverNewAreaEntity(
      areas: protocolList,
      elderInfos: protocolList1,
      dutyTypeDesc: json['dutyTypeDesc'],
      reportDate: json['reportDate'],
      relateElderCount: json['relateElderCount'],
      nurseCount: json['nurseCount'],
      elderCount: json['elderCount'],
      areaAuth: json['areaAuth'],
      id: json['id'],
      summary: json['summary'],
      summaryTime: json['summaryTime'],
      operator: json['operator'],
    );
  }
}

class HandoverNewAreaInfo {
  String? name;
  int? id;

  HandoverNewAreaInfo({
    this.name,
    this.id,
  });

  HandoverNewAreaInfo.fromJson(Map data) {
    name = data['name'];
    id = data['id'];
  }
}

class HandoverElderInfoEntity {
  List<HandoverElderInfo>? infos;
  String? customerElderName;
  String? roomNo;
  int? customerElderId;
  int? id;
  // int elderCount;
  HandoverElderInfoEntity({
    this.infos,
    this.customerElderName,
    this.roomNo,
    this.customerElderId,
    this.id,
    // this.elderCount,
  });

  factory HandoverElderInfoEntity.fromJson(Map<String, dynamic> json) {
    final originList = json['infos'] as List?;
    List<HandoverElderInfo> protocolList =
        (originList??[]).map((value) => HandoverElderInfo.fromJson(value)).toList();
    return HandoverElderInfoEntity(
      infos: protocolList,
      customerElderName: json['customerElderName'],
      roomNo: json['roomNo'],
      customerElderId: json['customerElderId'],
      id: json['id'],
      // elderCount: json['elderCount'],
    );
  }
}

class HandoverElderInfo {
  String? content;
  String? operator;
  String? reportDate;
  int? id;
  bool? operAuth; //追加意见权限，true时白哦是用户有该条数据的操作权限（修改、删除意见）
  List<HandoverRecordInfo>? records;

  HandoverElderInfo({
    this.content,
    this.operator,
    this.reportDate,
    this.id,
    this.operAuth,
    this.records,
  });

  factory HandoverElderInfo.fromJson(Map<String, dynamic> json) {
    final originList = json['records'] as List?;
    List<HandoverRecordInfo> protocolList =
        (originList??[]).map((value) => HandoverRecordInfo.fromJson(value)).toList();
    return HandoverElderInfo(
      records: protocolList,
      content: json['content'],
      operator: json['operator'],
      reportDate: json['reportDate'],
      id: json['id'],
      operAuth: json['operAuth'],
    );
  }
}


class HandoverRecordInfo {
  String? remark;
  String? operator;
  String? createdDate;
  int? id;
  int? focus;
  bool? operAuth;

  HandoverRecordInfo({
    this.remark,
    this.operator,
    this.createdDate,
    this.id,
    this.focus,
    this.operAuth,
  });

  HandoverRecordInfo.fromJson(Map data) {
    remark = data['remark'];
    operator = data['operator'];
    createdDate = data['createdDate'];
    id = data['id'];
    focus = data['focus'];
    operAuth = data['operAuth'];
  }
}